#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    this->setWindowState(Qt::WindowMaximized);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_action_new_window_triggered()
{
    NewForm *newForm = new NewForm(this);
    ui->mdiArea->addSubWindow(newForm);
    newForm->show();
}

void MainWindow::on_action_mdi_triggered()
{
    ui->mdiArea->tileSubWindows();
}

void MainWindow::on_action_tab_triggered()
{
    ui->mdiArea->setViewMode(QMdiArea::TabbedView);
    ui->mdiArea->setTabsClosable(true);
}
